<?

//当前类别
$this_type = 'et';



switch($type){
	case'add':		//添加
		
		//添加
		if($go=='insert'){
				$meid = (int)$meid;
				
				
				$subjects = trim($subjects);
				if(!$subjects){
					$error = 1;
					msg_error('抱歉，请输入文章标题！');
				}
				
				$contents = trim($contents);
				if(!$contents){
					$error = 1;
					basic::flash('抱歉，请输入文章内容！');
				}
				
				if($meid<=0){
					$error = 1;
					basic::flash('抱歉，请选择属于菜单！');
				}
				
				if($error!=1){
					$db->query("INSERT INTO manual_list (
					types,meid,usid,subjects,contents,dates 
					) VALUES(
					'$this_type','$meid','".$_SESSION['sys']['username']."','$subjects','$contents','".time()."'
					)");
					
					basic::flash('恭喜，资料添加成功！',"sys.php?model=admin&action={$action}&type=add",3);
				}
			}
	break;
	
}
		$mlist = $db->query("SELECT * FROM menus WHERE types='$this_type' ORDER BY orderby ASC, meid ASC");
		
		$posturl   = "sys.php?model=admin&action={$action}&type=add&go=insert";
		$this_file = $action;
		
		
Basic :: setModelFile('head');
Basic :: setModelFile($this_file);
Basic :: setModelFile('bottom');
$tpl->p($this_file);

?>